<%@ page contentType="text/html; charset=iso-8859-1"%>
<%@ page language="java"%>
<%@ page import="java.util.*,java.sql.*,java.math.BigDecimal,java.text.SimpleDateFormat" %>

<%@ page import="pc.util.*,pc.system.*,wstrader.*,wstrader.task.*" %>

<%
    Users usr = Trader.getUser(request.getParameter("uid"));
    usr.getRequest().setRequest(request);
    usr.getResponse().setResponse(response, out);
    usr.setDebug(true);
    String pad = "&nbsp;&nbsp;&nbsp;&nbsp;";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>WERNERSOFT PTE LTD</title>
        <meta http-equiv="Content-Type" content="text/html;  charset=iso-8859-1">
        <style>
            .scroll
            {
                FONT: 9pt arial;
                COLOR: #A2C5EC;
                background-color: #FFFFFF;
                border: medium none
            }
            div#companyLogo{
                left: 10%;
                top: 1%;
                position: absolute;
            }
        </style>

    </head>

    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="load_date('clock_txt');">

        <script language="javascript">
            var current_year = <%=Utils.getCurYear() - 1%>;
        </script>

        <SCRIPT LANGUAGE="JavaScript" SRC="../shared/js/Utils.js"></SCRIPT>
        <!--<SCRIPT LANGUAGE="JavaScript" SRC="js/UtilsLib.js"></SCRIPT> -->
        <SCRIPT LANGUAGE="JavaScript" SRC="../shared/js/calendar.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript" SRC="../shared/js/timer.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript" SRC="task.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript" SRC="trade.js"></SCRIPT>

        <%@include file="grade.jsp"%>

        <script language="JavaScript">


            function doPost()
            {
                document.formMain.submit();
            }

            function doLink(linkPage)
            {
                if (linkPage == "") return;
                document.formMain.action = linkPage;
                doPost();
            }

            function doTask(task_id)
            {
                if (task_id == null) task_id = 0;
                setValue("task_id",task_id);
                doPost();
            }

            function changePassword()
            {
                var form = document.formMain;
                form.action = "change-password.jsp";
                form.submit();
            }

            function oneTitle(no)
            {
                var c = 0;
                for (var i = 1; getObj("e"+no+i) != null ; i ++) {
                    var text_v = getText("v"+no+i);
                    if (text_v != "")	{
                        var text_e = getText("e"+no+i);
                        setText("e"+no+i,text_v);
                        setText("v"+no+i,text_e);
                    }
                    c++;
                }
                return c;
            }

            function langChanged()
            {
                for (var i = 1; oneTitle(i) > 0 ; i ++) {
			
                }
            }	

            function doSort(table,field)
            {
                setValue("sorted_table", table);
                setValue("sorted_field", field);
                doPost();
            }


        </script>
        <div id="companyLogo"> 
            <img src="images/SWLogo3D.jpg" width="40" height="40"/>
        </div>
        <table id="screen_" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>           
                <td valign="top" background="images/bg-0.jpg" align="center">
                    <table id="menu_" width="650" border="0" cellpadding="0" cellspacing="0" align="center">		  
                        <tr>
                            <td valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr> 
                                        <td><img src="images/ws-trader.jpg" width="600" height="56"></td>
                                        <td align=""></td>
                                    </tr>
                                </table></td>
                        </tr>
                        <tr>
                            <td align="left"><%for (int i = 0; i < user.getChildSize(); i++) {
                                        Tasks ts = (Tasks) (user.getTask(i));%><img src="<%=ts.getButton().getImage()%>" width="78" height="28" onClick="doLink('<%=ts.doLink()%>')"><%}%></td>
                        </tr>
                        <tr>
                            <td height="21" valign="top" align="left">
                                <%
                                    Tasks t2 = (Tasks) user.getTaskLevel(0);
                                    Tasks t3 = (Tasks) user.getTaskLevel(1);
                                    for (int i = 0; (t2 != null) && (i < t2.getChildSize()); i++) {
                                        Tasks ts = t2.getTask(i);
                                %>
                                <img src="<%=ts.getButton().getImage()%>" border="0" onClick="doLink('<%=ts.doLink()%>')">
                                <%
                                    }
                                %></td>
                        </tr>
                    </table></td>
            </tr>
        </table>
        <%
            String display = user.Authenticated() ? "" : "none";
            String logout_str = user.getLanguage().equals("us") ? "Logout" : "Tho&aacute;t";
            String change_pwd_str = user.getLanguage().equals("us") ? "Change password" : "&#272;&#7893;i m&#7853;t kh&#7849;u";
        %>

        <table id="main_window" width="<%=Trader.window_width%>" align="center" border="0" cellpadding="0" cellspacing="0">
            <%Trader.window_width = "1000";%>
            <tr>
                <td><table width="100%" align="center" style="display: " cellpadding="0" cellspacing="0">
                        <tr style="font-family:Arial, Helvetica, sans-serif;font-size:11px">
                            <td style="display:<%=display%>">Welcome, <%=user.getFullName()%> [<a href="Trader?taskID=2" style="color:#0099FF"><%=logout_str%></a>,<a href="javascript:changePassword();" style="color:#0099FF"><%=change_pwd_str%></a>]</td>
                            <td align="right"><label id="clock_txt" style="color:#BBBBBB">&nbsp;</label></td>
                        </tr>
                    </table></td>
            </tr>
            <tr>
                <td width="100%"><table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td><table width="100%" border="1" cellpadding="1" cellspacing="1" align="center">
                                    <tr>
                                        <td  id="sub_menu_3" width="110" valign="top" style="display:<%=(t3 == null || t3.getChildSize() == 0) ? "none" : ""%>">
                                            <div align="justify" id="sub_menu"  style="BORDER:0px ; OVERFLOW:; WIDTH: 100%; HEIGHT: 100%; display:;">      
                                                <table width="100%" cellpadding="1" cellspacing="1" border="0">
                                                    <%
                                                        for (int i = 0; (t3 != null) && (i < t3.getChildSize()); i++) {
                                                            Tasks ts = t3.getTask(i);
                                                    %>		
                                                    <tr>
                                                        <td height="32" align="center"><img src="<%=ts.getButton().getImage()%>" border="0" onClick="doLink('<%=ts.doLink()%>')"></td>
                                                    </tr>
                                                    <%
                                                        }
                                                    %>					
                                                </table>
                                            </div>
                                        </td>

                                        <td  valign="top" bgcolor="#FBFBF5" background=""><table width="100%" height="100%" border="0">
                                                <tr valign="top">
                                                    <td><!-- This area for the contents of body-->
                                                        <% if (false) {%>
                                                    </td>
                                                </tr>
                                            </table></td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table></td>
            </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
                <td height="30" align="center" valign="middle" style="font-family:Arial, Helvetica, sans-serif;font-size:10px">Copyright &copy; 2005 Werner Soft Pte Ltd., All rights reserved.</td>
            </tr>
        </table>

    </body>
</html>

<%}%>
